package router

import (
	"github.com/gin-gonic/gin"
	"post/handler/service"
)

func Router() *gin.Engine {
	r := gin.Default()
	postApi := r.Group("/api/post")
	{
		postApi.POST("addPost", service.AddPost)
		postApi.GET("getPostList", service.GetPostList)
		postApi.GET("getMyPost", service.GetMyPost)
		postApi.GET("getPost", service.GetPost)
		postApi.GET("delPost", service.DelPost)
	}
	fileApi := r.Group("/api/file")
	{
		fileApi.POST("/ossUpload", service.OssUpload)
	}
	userApi := r.Group("/api/user")
	{
		userApi.POST("/user", service.User)
	}
	reviewApi := r.Group("/api/review")
	{
		reviewApi.POST("/review", service.Review)
	}
	return r
}
